package com.gemme.gemme.gwc;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.gemme.gemme.BaseActivity;
import com.gemme.gemme.MainActivity;
import com.gemme.gemme.R;
import com.gemme.gemme.util.DpUtil;
import com.gemme.gemme.util.ShapeUtil;
import com.gemme.gemme.view.FaPiaoDialog;
import com.gemme.gemme.view.Topview;
import com.gemme.gemme.view.TvTvArrow;
import com.gemme.gemme.wode.AddAddressActivity;
import com.gemme.gemme.wode.DDDfhActivity;
import com.gemme.gemme.wode.WoDingdanNewActivity;
import com.jaeger.library.StatusBarUtil;

import androidx.annotation.Nullable;

public class PaySucessActivity extends BaseActivity  {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pay_suess);
        initView();
        initTop();
        getIntentData();
    }
    Long orderDetailId;
    private void getIntentData() {
        try {
            String data = getIntent().getStringExtra("data");
            OnProductBean bean = JSON.parseObject(data, OnProductBean.class);
            orderDetailId = bean.getOrderDetailId();
            tv_price.setText(bean.getOrderSubtotal() + "");
        }catch (Exception e){

        }
    }

    private void initTop() {
//        StatusBarUtil.setColor(this,getResources().getColor(R.color.white_color) );
        StatusBarUtil.setTransparent(this);
//        StatusBarUtil.setTranslucent(this,250);
        Topview topview = findViewById(R.id.topview);
        topview.setContentText("支付成功");
    }
    TextView tv_price;
    TextView tv_order;
    private void initView() {
       TextView tv_return_home =  findViewById(R.id.tv_return_home);
        tv_return_home.setBackground(ShapeUtil.setCornBgStrok(DpUtil.dp2px((Activity) mContext,4),"#ffffffff",
                DpUtil.dp2px((Activity) mContext,1),"#FF9D2C2F"));
        tv_price = findViewById(R.id.tv_price);
        tv_order = findViewById(R.id.tv_order);


        tv_order.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
               /* Intent intent = new Intent(mContext, DDDfhActivity.class);
                intent.putExtra("data",orderDetailId);
                startActivity(intent);*/
                Intent intent2 = new Intent(mContext, WoDingdanNewActivity.class);
                intent2.putExtra("type",2);
                startActivity(intent2);
                finish();
            }
        });

        tv_return_home.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(mContext, MainActivity.class));
                finish();
            }
        });
    }



}